package org.fisco.bcos.sdk.demo.contract;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.fisco.bcos.sdk.v3.client.Client;
import org.fisco.bcos.sdk.v3.codec.datatypes.Bool;
import org.fisco.bcos.sdk.v3.codec.datatypes.DynamicArray;
import org.fisco.bcos.sdk.v3.codec.datatypes.Event;
import org.fisco.bcos.sdk.v3.codec.datatypes.Function;
import org.fisco.bcos.sdk.v3.codec.datatypes.Type;
import org.fisco.bcos.sdk.v3.codec.datatypes.TypeReference;
import org.fisco.bcos.sdk.v3.codec.datatypes.Utf8String;
import org.fisco.bcos.sdk.v3.codec.datatypes.generated.Int256;
import org.fisco.bcos.sdk.v3.codec.datatypes.generated.Uint256;
import org.fisco.bcos.sdk.v3.codec.datatypes.generated.tuples.generated.Tuple1;
import org.fisco.bcos.sdk.v3.codec.datatypes.generated.tuples.generated.Tuple2;
import org.fisco.bcos.sdk.v3.codec.datatypes.generated.tuples.generated.Tuple5;
import org.fisco.bcos.sdk.v3.codec.datatypes.generated.tuples.generated.Tuple6;
import org.fisco.bcos.sdk.v3.codec.datatypes.generated.tuples.generated.Tuple7;
import org.fisco.bcos.sdk.v3.contract.Contract;
import org.fisco.bcos.sdk.v3.crypto.CryptoSuite;
import org.fisco.bcos.sdk.v3.crypto.keypair.CryptoKeyPair;
import org.fisco.bcos.sdk.v3.model.CryptoType;
import org.fisco.bcos.sdk.v3.model.TransactionReceipt;
import org.fisco.bcos.sdk.v3.model.callback.TransactionCallback;
import org.fisco.bcos.sdk.v3.transaction.model.exception.ContractException;

@SuppressWarnings("unchecked")
public class TigerHoleV2 extends Contract {
    public static final String[] BINARY_ARRAY = {
        "608060405261040060005561012c60015560006005557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6006557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe6007557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd6008557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc6009557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb600a557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600b557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9600c557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8600d557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7600e557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6600f557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff56010557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff46011557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff36012553480156101f557600080fd5b50611e63806102056000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80635d49d5c71161005b5780635d49d5c71461010757806360b402a714610137578063bca926af14610167578063f350cf1f146101715761007d565b80630e766cce14610082578063207add91146100b657806331feb671146100d2575b600080fd5b61009c6004803603810190610097919061153f565b6101a5565b6040516100ad959493929190611af9565b60405180910390f35b6100d060048036038101906100cb91906116d0565b610411565b005b6100ec60048036038101906100e79190611591565b610423565b6040516100fe96959493929190611a68565b60405180910390f35b610121600480360381019061011c91906115d2565b610730565b60405161012e9190611ade565b60405180910390f35b610151600480360381019061014c91906114fe565b610ec3565b60405161015e9190611a46565b60405180910390f35b61016f610f86565b005b61018b60048036038101906101869190611591565b61101f565b60405161019c959493929190611b61565b60405180910390f35b606080600080606060046000878152602001908152602001600020600001600460008881526020019081526020016000206001016004600089815260200190815260200160002060020160009054906101000a900460ff16600460008a815260200190815260200160002060030154600460008b8152602001908152602001600020600401848054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102bf5780601f10610294576101008083540402835291602001916102bf565b820191906000526020600020905b8154815290600101906020018083116102a257829003601f168201915b50505050509450838054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561035b5780601f106103305761010080835404028352916020019161035b565b820191906000526020600020905b81548152906001019060200180831161033e57829003601f168201915b50505050509350808054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103f75780601f106103cc576101008083540402835291602001916103f7565b820191906000526020600020905b8154815290600101906020018083116103da57829003601f168201915b505050505090509450945094509450945091939590929450565b81600081905550806001819055505050565b6060806060600080600060028760405161043d91906119f3565b908152602001604051809103902060000160028860405161045e91906119f3565b908152602001604051809103902060010160028960405161047f91906119f3565b908152602001604051809103902060020160028a6040516104a091906119f3565b90815260200160405180910390206003015460028b6040516104c291906119f3565b90815260200160405180910390206004015460028c6040516104e491906119f3565b908152602001604051809103902060050160009054906101000a900460ff168580548060200260200160405190810160405280929190818152602001828054801561054e57602002820191906000526020600020905b81548152602001906001019080831161053a575b5050505050955084805480602002602001604051908101604052809291908181526020016000905b82821015610632578382906000526020600020018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561061e5780601f106105f35761010080835404028352916020019161061e565b820191906000526020600020905b81548152906001019060200180831161060157829003601f168201915b505050505081526020019060010190610576565b50505050945083805480602002602001604051908101604052809291908181526020016000905b82821015610715578382906000526020600020018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107015780601f106106d657610100808354040283529160200191610701565b820191906000526020600020905b8154815290600101906020018083116106e457829003601f168201915b505050505081526020019060010190610659565b50505050935095509550955095509550955091939550919395565b60008088511415610745576006549050610eb8565b6000600460008981526020019081526020016000206000018054600181600116156101000203166002900490501115610782576007549050610eb8565b60005460028960405161079591906119f3565b908152602001604051809103902060000180549050106107b9576008549050610eb8565b6000841415610865576002886040516107d291906119f3565b908152602001604051809103902060050160009054906101000a900460ff161561080057600b549050610eb8565b8660028960405161081191906119f3565b908152602001604051809103902060040181905550600160028960405161083891906119f3565b908152602001604051809103902060050160006101000a81548160ff021916908315150217905550610cc1565b6001841415610ca75760015460028760405161088191906119f3565b908152602001604051809103902060030154106108a2576009549050610eb8565b60006003866040516108b491906119f3565b908152602001604051809103902060010154141561098857856003866040516108dd91906119f3565b90815260200160405180910390206000019080519060200190610901929190611343565b508260038660405161091391906119f3565b90815260200160405180910390206001018190555060028660405161093891906119f3565b908152602001604051809103902060010185908060018154018082558091505060019003906000526020600020016000909190919091509080519060200190610982929190611343565b50610a3d565b6001151560038660405161099c91906119f3565b9081526020016040518091039020600401896040516109bb91906119f3565b908152602001604051809103902060009054906101000a900460ff16151514156109e957600c549050610eb8565b6003856040516109f991906119f3565b908152602001604051809103902060010154600386604051610a1b91906119f3565b90815260200160405180910390206002015410610a3c57600a549050610eb8565b5b878051906020012086805190602001201415610a5d576012549050610eb8565b84600460008981526020019081526020016000206001019080519060200190610a87929190611343565b50600286604051610a9891906119f3565b90815260200160405180910390206003016000815460010191905081905550600385604051610ac791906119f3565b90815260200160405180910390206002016000815460010191905081905550600288604051610af691906119f3565b908152602001604051809103902060020185908060018154018082558091505060019003906000526020600020016000909190919091509080519060200190610b40929190611343565b50600385604051610b5191906119f3565b908152602001604051809103902060030188908060018154018082558091505060019003906000526020600020016000909190919091509080519060200190610b9b929190611343565b506001600386604051610bae91906119f3565b908152602001604051809103902060040189604051610bcd91906119f3565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f87609a1c514cae23b77b4fd88af05026dcd719531ae71a861f01fa806ba266a6600287604051610c2391906119f3565b908152602001604051809103902060030154604051610c429190611bc9565b60405180910390a17f708fc77dd8134f699822af898790d3337a8bb796d5ee813482ef02928717f111600386604051610c7b91906119f3565b908152602001604051809103902060020154604051610c9a9190611bc9565b60405180910390a1610cc0565b6002841415610cb557610cbf565b600d549050610eb8565b5b5b87600460008981526020019081526020016000206000019080519060200190610ceb929190611343565b50836004600089815260200190815260200160002060030181905550600288604051610d1791906119f3565b908152602001604051809103902060000187908060018154018082558091505060019003906000526020600020016000909190919091505560008251118015610d8a5750600060046000898152602001908152602001600020600401805460018160011615610100020316600290049050145b15610e205781600460008981526020019081526020016000206004019080519060200190610db9929190611343565b506001841415610e1f57600385604051610dd391906119f3565b908152602001604051809103902060050182908060018154018082558091505060019003906000",
        "526020600020016000909190919091509080519060200190610e1d929190611343565b505b5b7ffd341493d5eeef63777b9b32d0bc62268694f851c0904b761347a998e69a96a4600289604051610e5191906119f3565b908152602001604051809103902060000180549050604051610e739190611bc9565b60405180910390a17f048e8d4028ef03595be7b543b52980c60dabb6ab2ecf1b665e5f63c705cc285587604051610eaa9190611ade565b60405180910390a160055490505b979650505050505050565b6060815167ffffffffffffffff81118015610edd57600080fd5b50604051908082528060200260200182016040528015610f0c5781602001602082028036833780820191505090505b50905060008090505b8251811015610f805760046000848381518110610f2e57fe5b6020026020010151815260200190815260200160002060020160009054906101000a900460ff16828281518110610f6157fe5b6020026020010190151590811515815250508080600101915050610f15565b50919050565b600061100690508073ffffffffffffffffffffffffffffffffffffffff16630553904e3060046040518363ffffffff1660e01b8152600401610fc9929190611a0a565b602060405180830381600087803b158015610fe357600080fd5b505af1158015610ff7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101b9190611568565b5050565b606060008060608060038660405161103791906119f3565b908152602001604051809103902060000160038760405161105891906119f3565b90815260200160405180910390206001015460038860405161107a91906119f3565b90815260200160405180910390206002015460038960405161109c91906119f3565b908152602001604051809103902060030160038a6040516110bd91906119f3565b9081526020016040518091039020600501848054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111635780601f1061113857610100808354040283529160200191611163565b820191906000526020600020905b81548152906001019060200180831161114657829003601f168201915b5050505050945081805480602002602001604051908101604052809291908181526020016000905b82821015611247578382906000526020600020018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112335780601f1061120857610100808354040283529160200191611233565b820191906000526020600020905b81548152906001019060200180831161121657829003601f168201915b50505050508152602001906001019061118b565b50505050915080805480602002602001604051908101604052809291908181526020016000905b8282101561132a578382906000526020600020018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113165780601f106112eb57610100808354040283529160200191611316565b820191906000526020600020905b8154815290600101906020018083116112f957829003601f168201915b50505050508152602001906001019061126e565b5050505090509450945094509450945091939590929450565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061138457805160ff19168380011785556113b2565b828001600101855582156113b2579182015b828111156113b1578251825591602001919060010190611396565b5b5090506113bf91906113c3565b5090565b6113e591905b808211156113e15760008160009055506001016113c9565b5090565b90565b600082601f8301126113f957600080fd5b813561140c61140782611c11565b611be4565b9150818183526020840193506020810190508385602084028201111561143157600080fd5b60005b838110156114615781611447888261146b565b845260208401935060208301925050600181019050611434565b5050505092915050565b60008135905061147a81611dff565b92915050565b60008151905061148f81611dff565b92915050565b600082601f8301126114a657600080fd5b81356114b96114b482611c39565b611be4565b915080825260208301602083018583830111156114d557600080fd5b6114e0838284611dac565b50505092915050565b6000813590506114f881611e16565b92915050565b60006020828403121561151057600080fd5b600082013567ffffffffffffffff81111561152a57600080fd5b611536848285016113e8565b91505092915050565b60006020828403121561155157600080fd5b600061155f8482850161146b565b91505092915050565b60006020828403121561157a57600080fd5b600061158884828501611480565b91505092915050565b6000602082840312156115a357600080fd5b600082013567ffffffffffffffff8111156115bd57600080fd5b6115c984828501611495565b91505092915050565b600080600080600080600060e0888a0312156115ed57600080fd5b600088013567ffffffffffffffff81111561160757600080fd5b6116138a828b01611495565b97505060206116248a828b0161146b565b965050604088013567ffffffffffffffff81111561164157600080fd5b61164d8a828b01611495565b955050606088013567ffffffffffffffff81111561166a57600080fd5b6116768a828b01611495565b94505060806116878a828b0161146b565b93505060a06116988a828b016114e9565b92505060c088013567ffffffffffffffff8111156116b557600080fd5b6116c18a828b01611495565b91505092959891949750929550565b600080604083850312156116e357600080fd5b60006116f1858286016114e9565b9250506020611702858286016114e9565b9150509250929050565b60006117188383611890565b60208301905092915050565b600061173083836118ae565b60208301905092915050565b600061174883836118db565b905092915050565b61175981611d48565b82525050565b600061176a82611c95565b6117748185611ce8565b935061177f83611c65565b8060005b838110156117b0578151611797888261170c565b97506117a283611cc1565b925050600181019050611783565b5085935050505092915050565b60006117c882611ca0565b6117d28185611cf9565b93506117dd83611c75565b8060005b8381101561180e5781516117f58882611724565b975061180083611cce565b9250506001810190506117e1565b5085935050505092915050565b600061182682611cab565b6118308185611d0a565b93508360208202850161184285611c85565b8060005b8581101561187e578484038952815161185f858261173c565b945061186a83611cdb565b925060208a01995050600181019050611846565b50829750879550505050505092915050565b61189981611d5a565b82525050565b6118a881611d5a565b82525050565b6118b781611d66565b82525050565b6118c681611d66565b82525050565b6118d581611d9a565b82525050565b60006118e682611cb6565b6118f08185611d1b565b9350611900818560208601611dbb565b61190981611dee565b840191505092915050565b600061191f82611cb6565b6119298185611d2c565b9350611939818560208601611dbb565b61194281611dee565b840191505092915050565b600061195882611cb6565b6119628185611d3d565b9350611972818560208601611dbb565b80840191505092915050565b600061198b603d83611d2c565b91507f7472616465546967657228737472696e672c696e743235362c737472696e672c60008301527f737472696e672c696e743235362c75696e743235362c737472696e67290000006020830152604082019050919050565b6119ed81611d90565b82525050565b60006119ff828461194d565b915081905092915050565b6000606082019050611a1f6000830185611750565b8181036020830152611a308161197e565b9050611a3f60408301846118cc565b9392505050565b60006020820190508181036000830152611a60818461175f565b905092915050565b600060c0820190508181036000830152611a8281896117bd565b90508181036020830152611a96818861181b565b90508181036040830152611aaa818761181b565b9050611ab960608301866119e4565b611ac660808301856118bd565b611ad360a083018461189f565b979650505050505050565b6000602082019050611af360008301846118bd565b92915050565b600060a0820190508181036000830152611b138188611914565b90508181036020830152611b278187611914565b9050611b36604083018661189f565b611b4360608301856118bd565b8181036080830152611b558184611914565b90509695505050505050565b600060a0820190508181036000830152611b7b8188611914565b9050611b8a60208301876119e4565b611b9760408301866119e4565b8181036060830152611ba9818561181b565b90508181036080830152611bbd818461181b565b90509695505050505050565b6000602082019050611bde60008301846119e4565b92915050565b6000604051905081810181811067ffffffffffffffff82111715611c0757600080fd5b8060405250919050565b600067ffffffffffffffff821115611c2857600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115611c5057600080fd5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b6000611d5382611d70565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000611da582611d90565b9050919050565b82818337600083830152505050565b60005b83811015611dd9578082015181840152602081019050611dbe565b83811115611de8576000848401525b50505050565b6000601f19601f8301169050",
        "919050565b611e0881611d66565b8114611e1357600080fd5b50565b611e1f81611d90565b8114611e2a57600080fd5b5056fea264697066735822122046e27e8c252d02d9ec566ce5210f5a1d7cfc6bd362137978e5c1002d5668e48f64736f6c634300060a0033"
    };

    public static final String BINARY =
            org.fisco.bcos.sdk.v3.utils.StringUtils.joinAll("", BINARY_ARRAY);

    public static final String[] SM_BINARY_ARRAY = {
        "608060405261040060005561012c60015560006005557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6006557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe6007557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd6008557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc6009557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb600a557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600b557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9600c557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8600d557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7600e557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6600f557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff56010557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff46011557ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff36012553480156101f557600080fd5b50611e63806102056000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806394618e4c1161005b57806394618e4c1461010257806399db3a731461010c578063b879a4c71461013c578063dff30bc0146101715761007d565b806309b516901461008257806311a8ce881461009e57806328d882e2146100ce575b600080fd5b61009c600480360381019061009791906116d0565b6101a5565b005b6100b860048036038101906100b391906114fe565b6101b7565b6040516100c59190611a46565b60405180910390f35b6100e860048036038101906100e3919061153f565b61027a565b6040516100f9959493929190611af9565b60405180910390f35b61010a6104e6565b005b610126600480360381019061012191906115d2565b61057f565b6040516101339190611ade565b60405180910390f35b61015660048036038101906101519190611591565b610d12565b60405161016896959493929190611a68565b60405180910390f35b61018b60048036038101906101869190611591565b61101f565b60405161019c959493929190611b61565b60405180910390f35b81600081905550806001819055505050565b6060815167ffffffffffffffff811180156101d157600080fd5b506040519080825280602002602001820160405280156102005781602001602082028036833780820191505090505b50905060008090505b8251811015610274576004600084838151811061022257fe5b6020026020010151815260200190815260200160002060020160009054906101000a900460ff1682828151811061025557fe5b6020026020010190151590811515815250508080600101915050610209565b50919050565b606080600080606060046000878152602001908152602001600020600001600460008881526020019081526020016000206001016004600089815260200190815260200160002060020160009054906101000a900460ff16600460008a815260200190815260200160002060030154600460008b8152602001908152602001600020600401848054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103945780601f1061036957610100808354040283529160200191610394565b820191906000526020600020905b81548152906001019060200180831161037757829003601f168201915b50505050509450838054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104305780601f1061040557610100808354040283529160200191610430565b820191906000526020600020905b81548152906001019060200180831161041357829003601f168201915b50505050509350808054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104cc5780601f106104a1576101008083540402835291602001916104cc565b820191906000526020600020905b8154815290600101906020018083116104af57829003601f168201915b505050505090509450945094509450945091939590929450565b600061100690508073ffffffffffffffffffffffffffffffffffffffff1663dc536a623060046040518363ffffffff1660e01b8152600401610529929190611a0a565b602060405180830381600087803b15801561054357600080fd5b505af1158015610557573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057b9190611568565b5050565b60008088511415610594576006549050610d07565b60006004600089815260200190815260200160002060000180546001816001161561010002031660029004905011156105d1576007549050610d07565b6000546002896040516105e491906119f3565b90815260200160405180910390206000018054905010610608576008549050610d07565b60008414156106b45760028860405161062191906119f3565b908152602001604051809103902060050160009054906101000a900460ff161561064f57600b549050610d07565b8660028960405161066091906119f3565b908152602001604051809103902060040181905550600160028960405161068791906119f3565b908152602001604051809103902060050160006101000a81548160ff021916908315150217905550610b10565b6001841415610af6576001546002876040516106d091906119f3565b908152602001604051809103902060030154106106f1576009549050610d07565b600060038660405161070391906119f3565b90815260200160405180910390206001015414156107d7578560038660405161072c91906119f3565b90815260200160405180910390206000019080519060200190610750929190611343565b508260038660405161076291906119f3565b90815260200160405180910390206001018190555060028660405161078791906119f3565b9081526020016040518091039020600101859080600181540180825580915050600190039060005260206000200160009091909190915090805190602001906107d1929190611343565b5061088c565b600115156003866040516107eb91906119f3565b90815260200160405180910390206004018960405161080a91906119f3565b908152602001604051809103902060009054906101000a900460ff161515141561083857600c549050610d07565b60038560405161084891906119f3565b90815260200160405180910390206001015460038660405161086a91906119f3565b9081526020016040518091039020600201541061088b57600a549050610d07565b5b8780519060200120868051906020012014156108ac576012549050610d07565b846004600089815260200190815260200160002060010190805190602001906108d6929190611343565b506002866040516108e791906119f3565b9081526020016040518091039020600301600081546001019190508190555060038560405161091691906119f3565b9081526020016040518091039020600201600081546001019190508190555060028860405161094591906119f3565b90815260200160405180910390206002018590806001815401808255809150506001900390600052602060002001600090919091909150908051906020019061098f929190611343565b506003856040516109a091906119f3565b9081526020016040518091039020600301889080600181540180825580915050600190039060005260206000200160009091909190915090805190602001906109ea929190611343565b5060016003866040516109fd91906119f3565b908152602001604051809103902060040189604051610a1c91906119f3565b908152602001604051809103902060006101000a81548160ff0219169083151502179055507f96dff299e9c393b410a3143f0447c7b1c3f021468d248a04ef3e907483cb0ad5600287604051610a7291906119f3565b908152602001604051809103902060030154604051610a919190611bc9565b60405180910390a17fda2b777ecf22957bf55f40fb6e1d664c625e3ebee1a16aedb137468089f4d886600386604051610aca91906119f3565b908152602001604051809103902060020154604051610ae99190611bc9565b60405180910390a1610b0f565b6002841415610b0457610b0e565b600d549050610d07565b5b5b87600460008981526020019081526020016000206000019080519060200190610b3a929190611343565b50836004600089815260200190815260200160002060030181905550600288604051610b6691906119f3565b908152602001604051809103902060000187908060018154018082558091505060019003906000526020600020016000909190919091505560008251118015610bd95750600060046000898152602001908152602001600020600401805460018160011615610100020316600290049050145b15610c6f5781600460008981526020019081526020016000206004019080519060200190610c08929190611343565b506001841415610c6e57600385604051610c2291906119f3565b908152602001604051809103902060050182908060018154018082558091505060019003906000526020600020016000909190919091509080519060200190610c6c929190611343565b505b5b7fe710cf5e148cda86a54b02cb2eef7b644b5eddd3861e6924e334bb9afe327fac600289604051610ca091906119f3565b908152602001604051809103902060000180549050604051610cc29190611bc9565b60405180910390a17fa3c54e9dd9cd0b7a4980113927b8db85658a24c25b6dcae02c25f7505c6f787f87604051610cf99190611ade565b60405180910390a160055490505b979650505050505050565b60608060606000806000600287604051610d2c91906119f3565b9081526020016040518091039020600001600288604051610d4d91906119f3565b9081526020016040518091039020600101600289604051610d6e91906119f3565b908152602001604051809103902060020160028a604051610d8f91906119f3565b90815260200160405180910390206003015460028b604051610db191906119f3565b90815260200160405180910390206004015460028c604051610dd391906119f3565b908152602001604051809103902060050160009054906101000a900460ff168580548060200260",
        "2001604051908101604052809291908181526020018280548015610e3d57602002820191906000526020600020905b815481526020019060010190808311610e29575b5050505050955084805480602002602001604051908101604052809291908181526020016000905b82821015610f21578382906000526020600020018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f0d5780601f10610ee257610100808354040283529160200191610f0d565b820191906000526020600020905b815481529060010190602001808311610ef057829003601f168201915b505050505081526020019060010190610e65565b50505050945083805480602002602001604051908101604052809291908181526020016000905b82821015611004578382906000526020600020018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ff05780601f10610fc557610100808354040283529160200191610ff0565b820191906000526020600020905b815481529060010190602001808311610fd357829003601f168201915b505050505081526020019060010190610f48565b50505050935095509550955095509550955091939550919395565b606060008060608060038660405161103791906119f3565b908152602001604051809103902060000160038760405161105891906119f3565b90815260200160405180910390206001015460038860405161107a91906119f3565b90815260200160405180910390206002015460038960405161109c91906119f3565b908152602001604051809103902060030160038a6040516110bd91906119f3565b9081526020016040518091039020600501848054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111635780601f1061113857610100808354040283529160200191611163565b820191906000526020600020905b81548152906001019060200180831161114657829003601f168201915b5050505050945081805480602002602001604051908101604052809291908181526020016000905b82821015611247578382906000526020600020018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112335780601f1061120857610100808354040283529160200191611233565b820191906000526020600020905b81548152906001019060200180831161121657829003601f168201915b50505050508152602001906001019061118b565b50505050915080805480602002602001604051908101604052809291908181526020016000905b8282101561132a578382906000526020600020018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113165780601f106112eb57610100808354040283529160200191611316565b820191906000526020600020905b8154815290600101906020018083116112f957829003601f168201915b50505050508152602001906001019061126e565b5050505090509450945094509450945091939590929450565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061138457805160ff19168380011785556113b2565b828001600101855582156113b2579182015b828111156113b1578251825591602001919060010190611396565b5b5090506113bf91906113c3565b5090565b6113e591905b808211156113e15760008160009055506001016113c9565b5090565b90565b600082601f8301126113f957600080fd5b813561140c61140782611c11565b611be4565b9150818183526020840193506020810190508385602084028201111561143157600080fd5b60005b838110156114615781611447888261146b565b845260208401935060208301925050600181019050611434565b5050505092915050565b60008135905061147a81611dff565b92915050565b60008151905061148f81611dff565b92915050565b600082601f8301126114a657600080fd5b81356114b96114b482611c39565b611be4565b915080825260208301602083018583830111156114d557600080fd5b6114e0838284611dac565b50505092915050565b6000813590506114f881611e16565b92915050565b60006020828403121561151057600080fd5b600082013567ffffffffffffffff81111561152a57600080fd5b611536848285016113e8565b91505092915050565b60006020828403121561155157600080fd5b600061155f8482850161146b565b91505092915050565b60006020828403121561157a57600080fd5b600061158884828501611480565b91505092915050565b6000602082840312156115a357600080fd5b600082013567ffffffffffffffff8111156115bd57600080fd5b6115c984828501611495565b91505092915050565b600080600080600080600060e0888a0312156115ed57600080fd5b600088013567ffffffffffffffff81111561160757600080fd5b6116138a828b01611495565b97505060206116248a828b0161146b565b965050604088013567ffffffffffffffff81111561164157600080fd5b61164d8a828b01611495565b955050606088013567ffffffffffffffff81111561166a57600080fd5b6116768a828b01611495565b94505060806116878a828b0161146b565b93505060a06116988a828b016114e9565b92505060c088013567ffffffffffffffff8111156116b557600080fd5b6116c18a828b01611495565b91505092959891949750929550565b600080604083850312156116e357600080fd5b60006116f1858286016114e9565b9250506020611702858286016114e9565b9150509250929050565b60006117188383611890565b60208301905092915050565b600061173083836118ae565b60208301905092915050565b600061174883836118db565b905092915050565b61175981611d48565b82525050565b600061176a82611c95565b6117748185611ce8565b935061177f83611c65565b8060005b838110156117b0578151611797888261170c565b97506117a283611cc1565b925050600181019050611783565b5085935050505092915050565b60006117c882611ca0565b6117d28185611cf9565b93506117dd83611c75565b8060005b8381101561180e5781516117f58882611724565b975061180083611cce565b9250506001810190506117e1565b5085935050505092915050565b600061182682611cab565b6118308185611d0a565b93508360208202850161184285611c85565b8060005b8581101561187e578484038952815161185f858261173c565b945061186a83611cdb565b925060208a01995050600181019050611846565b50829750879550505050505092915050565b61189981611d5a565b82525050565b6118a881611d5a565b82525050565b6118b781611d66565b82525050565b6118c681611d66565b82525050565b6118d581611d9a565b82525050565b60006118e682611cb6565b6118f08185611d1b565b9350611900818560208601611dbb565b61190981611dee565b840191505092915050565b600061191f82611cb6565b6119298185611d2c565b9350611939818560208601611dbb565b61194281611dee565b840191505092915050565b600061195882611cb6565b6119628185611d3d565b9350611972818560208601611dbb565b80840191505092915050565b600061198b603d83611d2c565b91507f7472616465546967657228737472696e672c696e743235362c737472696e672c60008301527f737472696e672c696e743235362c75696e743235362c737472696e67290000006020830152604082019050919050565b6119ed81611d90565b82525050565b60006119ff828461194d565b915081905092915050565b6000606082019050611a1f6000830185611750565b8181036020830152611a308161197e565b9050611a3f60408301846118cc565b9392505050565b60006020820190508181036000830152611a60818461175f565b905092915050565b600060c0820190508181036000830152611a8281896117bd565b90508181036020830152611a96818861181b565b90508181036040830152611aaa818761181b565b9050611ab960608301866119e4565b611ac660808301856118bd565b611ad360a083018461189f565b979650505050505050565b6000602082019050611af360008301846118bd565b92915050565b600060a0820190508181036000830152611b138188611914565b90508181036020830152611b278187611914565b9050611b36604083018661189f565b611b4360608301856118bd565b8181036080830152611b558184611914565b90509695505050505050565b600060a0820190508181036000830152611b7b8188611914565b9050611b8a60208301876119e4565b611b9760408301866119e4565b8181036060830152611ba9818561181b565b90508181036080830152611bbd818461181b565b90509695505050505050565b6000602082019050611bde60008301846119e4565b92915050565b6000604051905081810181811067ffffffffffffffff82111715611c0757600080fd5b8060405250919050565b600067ffffffffffffffff821115611c2857600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115611c5057600080fd5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b6000611d5382611d70565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000611da582611d90565b9050919050565b82818337600083830152505050565b60005b83811015611dd9578082015181840152602081019050611dbe565b83811115611de8576000848401525b50505050565b6000601f19601f8301169050",
        "919050565b611e0881611d66565b8114611e1357600080fd5b50565b611e1f81611d90565b8114611e2a57600080fd5b5056fea26469706673582212203477d1b588a82884ce77441e56d7c59ea6652c1e1c9da9a7f55667037e914d8064736f6c634300060a0033"
    };

    public static final String SM_BINARY =
            org.fisco.bcos.sdk.v3.utils.StringUtils.joinAll("", SM_BINARY_ARRAY);

    public static final String[] ABI_ARRAY = {
        "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"cardSendedLog\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"fromUserSendedLog\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"name\":\"tigerIDReceivedLog\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"toUserOwnedLog\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"enableParallel\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"cardID\",\"type\":\"string\"}],\"name\":\"getCard\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"},{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"tigerID\",\"type\":\"int256\"}],\"name\":\"getTiger\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256[]\",\"name\":\"tigerIds\",\"type\":\"int256[]\"}],\"name\":\"getTigerMergeStatus\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"tigersMergeStatus\",\"type\":\"bool[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"openID\",\"type\":\"string\"}],\"name\":\"getUser\",\"outputs\":[{\"internalType\":\"int256[]\",\"name\":\"\",\"type\":\"int256[]\"},{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"},{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tigerOwnLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tigerSendLimit\",\"type\":\"uint256\"}],\"name\":\"setLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"toOpenID\",\"type\":\"string\"},{\"internalType\":\"int256\",\"name\":\"tigerID\",\"type\":\"int256\"},{\"internalType\":\"string\",\"name\":\"fromOpenID\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"cardID\",\"type\":\"string\"},{\"internalType\":\"int256\",\"name\":\"tradeType\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"cardLimit\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"tigerMemo\",\"type\":\"string\"}],\"name\":\"tradeTiger\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"
    };

    public static final String[] ABI_ARRAY_PARALLEL = {
        "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"cardSendedLog\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"fromUserSendedLog\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"name\":\"tigerIDReceivedLog\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"toUserOwnedLog\",\"type\":\"event\"},{\"conflictFields\":[{\"kind\":0}],\"inputs\":[],\"name\":\"enableParallel\",\"outputs\":[],\"selector\":[3165202095,2489421388],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":3,\"slot\":1,\"value\":[0]}],\"inputs\":[{\"internalType\":\"string\",\"name\":\"cardID\",\"type\":\"string\"}],\"name\":\"getCard\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"},{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"}],\"selector\":[4082159391,3757247424],\"stateMutability\":\"view\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":3,\"slot\":2,\"value\":[0]}],\"inputs\":[{\"internalType\":\"int256\",\"name\":\"tigerID\",\"type\":\"int256\"}],\"name\":\"getTiger\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"selector\":[242642126,685277922],\"stateMutability\":\"view\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":3,\"slot\":2,\"value\":[0]}],\"inputs\":[{\"internalType\":\"int256[]\",\"name\":\"tigerIds\",\"type\":\"int256[]\"}],\"name\":\"getTigerMergeStatus\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"tigersMergeStatus\",\"type\":\"bool[]\"}],\"selector\":[1622409895,296275592],\"stateMutability\":\"view\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":3,\"slot\":0,\"value\":[0]}],\"inputs\":[{\"internalType\":\"string\",\"name\":\"openID\",\"type\":\"string\"}],\"name\":\"getUser\",\"outputs\":[{\"internalType\":\"int256[]\",\"name\":\"\",\"type\":\"int256[]\"},{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"},{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"selector\":[838776433,3094979783],\"stateMutability\":\"view\",\"type\":\"function\"},{\"conflictFields\":[{\"kind\":3,\"slot\":0,\"value\":[0]},{\"kind\":3,\"slot\":0,\"value\":[2]},{\"kind\":3,\"slot\":1,\"value\":[3]},{\"kind\":3,\"slot\":2,\"value\":[1]}],\"inputs\":[{\"internalType\":\"string\",\"name\":\"toOpenID\",\"type\":\"string\"},{\"internalType\":\"int256\",\"name\":\"tigerID\",\"type\":\"int256\"},{\"internalType\":\"string\",\"name\":\"fromOpenID\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"cardID\",\"type\":\"string\"},{\"internalType\":\"int256\",\"name\":\"tradeType\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"cardLimit\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"tigerMemo\",\"type\":\"string\"}],\"name\":\"tradeTiger\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"selector\":[1565119943,2581281395],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"
    };

    public static final String ABI = org.fisco.bcos.sdk.v3.utils.StringUtils.joinAll("", ABI_ARRAY);
    public static final String PARALLEL_ABI =
            org.fisco.bcos.sdk.v3.utils.StringUtils.joinAll("", ABI_ARRAY_PARALLEL);

    public static final String FUNC_ENABLEPARALLEL = "enableParallel";

    public static final String FUNC_GETCARD = "getCard";

    public static final String FUNC_GETTIGER = "getTiger";

    public static final String FUNC_GETTIGERMERGESTATUS = "getTigerMergeStatus";

    public static final String FUNC_GETUSER = "getUser";

    public static final String FUNC_SETLIMIT = "setLimit";

    public static final String FUNC_TRADETIGER = "tradeTiger";

    public static final Event CARDSENDEDLOG_EVENT =
            new Event(
                    "cardSendedLog",
                    Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));;

    public static final Event FROMUSERSENDEDLOG_EVENT =
            new Event(
                    "fromUserSendedLog",
                    Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));;

    public static final Event TIGERIDRECEIVEDLOG_EVENT =
            new Event(
                    "tigerIDReceivedLog",
                    Arrays.<TypeReference<?>>asList(new TypeReference<Int256>() {}));;

    public static final Event TOUSEROWNEDLOG_EVENT =
            new Event(
                    "toUserOwnedLog",
                    Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));;

    protected TigerHoleV2(String contractAddress, Client client, CryptoKeyPair credential) {
        super(getBinary(client.getCryptoSuite()), contractAddress, client, credential);
    }

    public static String getBinary(CryptoSuite cryptoSuite) {
        return (cryptoSuite.getCryptoTypeConfig() == CryptoType.ECDSA_TYPE ? BINARY : SM_BINARY);
    }

    public static String getABI(boolean isParallel) {
        return isParallel ? PARALLEL_ABI : ABI;
    }

    public List<CardSendedLogEventResponse> getCardSendedLogEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList =
                extractEventParametersWithLog(CARDSENDEDLOG_EVENT, transactionReceipt);
        ArrayList<CardSendedLogEventResponse> responses =
                new ArrayList<CardSendedLogEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            CardSendedLogEventResponse typedResponse = new CardSendedLogEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.cardSendedLogParam0 =
                    (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public List<FromUserSendedLogEventResponse> getFromUserSendedLogEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList =
                extractEventParametersWithLog(FROMUSERSENDEDLOG_EVENT, transactionReceipt);
        ArrayList<FromUserSendedLogEventResponse> responses =
                new ArrayList<FromUserSendedLogEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            FromUserSendedLogEventResponse typedResponse = new FromUserSendedLogEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.fromUserSendedLogParam0 =
                    (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public List<TigerIDReceivedLogEventResponse> getTigerIDReceivedLogEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList =
                extractEventParametersWithLog(TIGERIDRECEIVEDLOG_EVENT, transactionReceipt);
        ArrayList<TigerIDReceivedLogEventResponse> responses =
                new ArrayList<TigerIDReceivedLogEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            TigerIDReceivedLogEventResponse typedResponse = new TigerIDReceivedLogEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.tigerIDReceivedLogParam0 =
                    (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public List<ToUserOwnedLogEventResponse> getToUserOwnedLogEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList =
                extractEventParametersWithLog(TOUSEROWNEDLOG_EVENT, transactionReceipt);
        ArrayList<ToUserOwnedLogEventResponse> responses =
                new ArrayList<ToUserOwnedLogEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            ToUserOwnedLogEventResponse typedResponse = new ToUserOwnedLogEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.toUserOwnedLogParam0 =
                    (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public TransactionReceipt enableParallel() {
        final Function function =
                new Function(
                        FUNC_ENABLEPARALLEL,
                        Arrays.<Type>asList(),
                        Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public void enableParallel(TransactionCallback callback) {
        final Function function =
                new Function(
                        FUNC_ENABLEPARALLEL,
                        Arrays.<Type>asList(),
                        Collections.<TypeReference<?>>emptyList());
        asyncExecuteTransaction(function, callback);
    }

    public String getSignedTransactionForEnableParallel() {
        final Function function =
                new Function(
                        FUNC_ENABLEPARALLEL,
                        Arrays.<Type>asList(),
                        Collections.<TypeReference<?>>emptyList());
        return createSignedTransaction(function);
    }

    public Tuple5<String, BigInteger, BigInteger, List<String>, List<String>> getCard(String cardID)
            throws ContractException {
        final Function function =
                new Function(
                        FUNC_GETCARD,
                        Arrays.<Type>asList(new Utf8String(cardID)),
                        Arrays.<TypeReference<?>>asList(
                                new TypeReference<Utf8String>() {},
                                new TypeReference<Uint256>() {},
                                new TypeReference<Uint256>() {},
                                new TypeReference<DynamicArray<Utf8String>>() {},
                                new TypeReference<DynamicArray<Utf8String>>() {}));
        List<Type> results = executeCallWithMultipleValueReturn(function);
        return new Tuple5<String, BigInteger, BigInteger, List<String>, List<String>>(
                (String) results.get(0).getValue(),
                (BigInteger) results.get(1).getValue(),
                (BigInteger) results.get(2).getValue(),
                convertToNative((List<Utf8String>) results.get(3).getValue()),
                convertToNative((List<Utf8String>) results.get(4).getValue()));
    }

    public Tuple5<String, String, Boolean, BigInteger, String> getTiger(BigInteger tigerID)
            throws ContractException {
        final Function function =
                new Function(
                        FUNC_GETTIGER,
                        Arrays.<Type>asList(new Int256(tigerID)),
                        Arrays.<TypeReference<?>>asList(
                                new TypeReference<Utf8String>() {},
                                new TypeReference<Utf8String>() {},
                                new TypeReference<Bool>() {},
                                new TypeReference<Int256>() {},
                                new TypeReference<Utf8String>() {}));
        List<Type> results = executeCallWithMultipleValueReturn(function);
        return new Tuple5<String, String, Boolean, BigInteger, String>(
                (String) results.get(0).getValue(),
                (String) results.get(1).getValue(),
                (Boolean) results.get(2).getValue(),
                (BigInteger) results.get(3).getValue(),
                (String) results.get(4).getValue());
    }

    public List getTigerMergeStatus(List<BigInteger> tigerIds) throws ContractException {
        final Function function =
                new Function(
                        FUNC_GETTIGERMERGESTATUS,
                        Arrays.<Type>asList(
                                new DynamicArray<Int256>(
                                        Int256.class,
                                        org.fisco.bcos.sdk.v3.codec.Utils.typeMap(
                                                tigerIds, Int256.class))),
                        Arrays.<TypeReference<?>>asList(
                                new TypeReference<DynamicArray<Bool>>() {}));
        List<Type> result = (List<Type>) executeCallWithSingleValueReturn(function, List.class);
        return convertToNative(result);
    }

    public Tuple6<List<BigInteger>, List<String>, List<String>, BigInteger, BigInteger, Boolean>
            getUser(String openID) throws ContractException {
        final Function function =
                new Function(
                        FUNC_GETUSER,
                        Arrays.<Type>asList(new Utf8String(openID)),
                        Arrays.<TypeReference<?>>asList(
                                new TypeReference<DynamicArray<Int256>>() {},
                                new TypeReference<DynamicArray<Utf8String>>() {},
                                new TypeReference<DynamicArray<Utf8String>>() {},
                                new TypeReference<Uint256>() {},
                                new TypeReference<Int256>() {},
                                new TypeReference<Bool>() {}));
        List<Type> results = executeCallWithMultipleValueReturn(function);
        return new Tuple6<
                List<BigInteger>, List<String>, List<String>, BigInteger, BigInteger, Boolean>(
                convertToNative((List<Int256>) results.get(0).getValue()),
                convertToNative((List<Utf8String>) results.get(1).getValue()),
                convertToNative((List<Utf8String>) results.get(2).getValue()),
                (BigInteger) results.get(3).getValue(),
                (BigInteger) results.get(4).getValue(),
                (Boolean) results.get(5).getValue());
    }

    public TransactionReceipt setLimit(BigInteger tigerOwnLimit, BigInteger tigerSendLimit) {
        final Function function =
                new Function(
                        FUNC_SETLIMIT,
                        Arrays.<Type>asList(
                                new Uint256(tigerOwnLimit), new Uint256(tigerSendLimit)),
                        Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public void setLimit(
            BigInteger tigerOwnLimit, BigInteger tigerSendLimit, TransactionCallback callback) {
        final Function function =
                new Function(
                        FUNC_SETLIMIT,
                        Arrays.<Type>asList(
                                new Uint256(tigerOwnLimit), new Uint256(tigerSendLimit)),
                        Collections.<TypeReference<?>>emptyList());
        asyncExecuteTransaction(function, callback);
    }

    public String getSignedTransactionForSetLimit(
            BigInteger tigerOwnLimit, BigInteger tigerSendLimit) {
        final Function function =
                new Function(
                        FUNC_SETLIMIT,
                        Arrays.<Type>asList(
                                new Uint256(tigerOwnLimit), new Uint256(tigerSendLimit)),
                        Collections.<TypeReference<?>>emptyList());
        return createSignedTransaction(function);
    }

    public Tuple2<BigInteger, BigInteger> getSetLimitInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function =
                new Function(
                        FUNC_SETLIMIT,
                        Arrays.<Type>asList(),
                        Arrays.<TypeReference<?>>asList(
                                new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}));
        List<Type> results =
                this.functionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple2<BigInteger, BigInteger>(
                (BigInteger) results.get(0).getValue(), (BigInteger) results.get(1).getValue());
    }

    public TransactionReceipt tradeTiger(
            String toOpenID,
            BigInteger tigerID,
            String fromOpenID,
            String cardID,
            BigInteger tradeType,
            BigInteger cardLimit,
            String tigerMemo) {
        final Function function =
                new Function(
                        FUNC_TRADETIGER,
                        Arrays.<Type>asList(
                                new Utf8String(toOpenID),
                                new Int256(tigerID),
                                new Utf8String(fromOpenID),
                                new Utf8String(cardID),
                                new Int256(tradeType),
                                new Uint256(cardLimit),
                                new Utf8String(tigerMemo)),
                        Collections.<TypeReference<?>>emptyList(),
                        4);
        return executeTransaction(function);
    }

    public void tradeTiger(
            String toOpenID,
            BigInteger tigerID,
            String fromOpenID,
            String cardID,
            BigInteger tradeType,
            BigInteger cardLimit,
            String tigerMemo,
            TransactionCallback callback) {
        final Function function =
                new Function(
                        FUNC_TRADETIGER,
                        Arrays.<Type>asList(
                                new Utf8String(toOpenID),
                                new Int256(tigerID),
                                new Utf8String(fromOpenID),
                                new Utf8String(cardID),
                                new Int256(tradeType),
                                new Uint256(cardLimit),
                                new Utf8String(tigerMemo)),
                        Collections.<TypeReference<?>>emptyList(),
                        4);
        asyncExecuteTransaction(function, callback);
    }

    public String getSignedTransactionForTradeTiger(
            String toOpenID,
            BigInteger tigerID,
            String fromOpenID,
            String cardID,
            BigInteger tradeType,
            BigInteger cardLimit,
            String tigerMemo) {
        final Function function =
                new Function(
                        FUNC_TRADETIGER,
                        Arrays.<Type>asList(
                                new Utf8String(toOpenID),
                                new Int256(tigerID),
                                new Utf8String(fromOpenID),
                                new Utf8String(cardID),
                                new Int256(tradeType),
                                new Uint256(cardLimit),
                                new Utf8String(tigerMemo)),
                        Collections.<TypeReference<?>>emptyList(),
                        4);
        return createSignedTransaction(function);
    }

    public Tuple7<String, BigInteger, String, String, BigInteger, BigInteger, String>
            getTradeTigerInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function =
                new Function(
                        FUNC_TRADETIGER,
                        Arrays.<Type>asList(),
                        Arrays.<TypeReference<?>>asList(
                                new TypeReference<Utf8String>() {},
                                new TypeReference<Int256>() {},
                                new TypeReference<Utf8String>() {},
                                new TypeReference<Utf8String>() {},
                                new TypeReference<Int256>() {},
                                new TypeReference<Uint256>() {},
                                new TypeReference<Utf8String>() {}));
        List<Type> results =
                this.functionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple7<String, BigInteger, String, String, BigInteger, BigInteger, String>(
                (String) results.get(0).getValue(),
                (BigInteger) results.get(1).getValue(),
                (String) results.get(2).getValue(),
                (String) results.get(3).getValue(),
                (BigInteger) results.get(4).getValue(),
                (BigInteger) results.get(5).getValue(),
                (String) results.get(6).getValue());
    }

    public Tuple1<BigInteger> getTradeTigerOutput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getOutput();
        final Function function =
                new Function(
                        FUNC_TRADETIGER,
                        Arrays.<Type>asList(),
                        Arrays.<TypeReference<?>>asList(new TypeReference<Int256>() {}));
        List<Type> results =
                this.functionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple1<BigInteger>((BigInteger) results.get(0).getValue());
    }

    public static TigerHoleV2 load(
            String contractAddress, Client client, CryptoKeyPair credential) {
        return new TigerHoleV2(contractAddress, client, credential);
    }

    public static TigerHoleV2 deploy(Client client, CryptoKeyPair credential, boolean isParallel)
            throws ContractException {
        return deploy(
                TigerHoleV2.class,
                client,
                credential,
                getBinary(client.getCryptoSuite()),
                getABI(isParallel),
                null,
                null);
    }

    public static class CardSendedLogEventResponse {
        public TransactionReceipt.Logs log;

        public BigInteger cardSendedLogParam0;
    }

    public static class FromUserSendedLogEventResponse {
        public TransactionReceipt.Logs log;

        public BigInteger fromUserSendedLogParam0;
    }

    public static class TigerIDReceivedLogEventResponse {
        public TransactionReceipt.Logs log;

        public BigInteger tigerIDReceivedLogParam0;
    }

    public static class ToUserOwnedLogEventResponse {
        public TransactionReceipt.Logs log;

        public BigInteger toUserOwnedLogParam0;
    }
}
